#include <tsin/runtime/Engine.hpp>

#include <tsin/runtime/Work.hpp>

#include <tsin/util/Timer.hpp>

using namespace tsin;

Engine::Engine()
        : works(0), done(true)
{
}

void Engine::run(GameRuntime *runtime)
{
        int i;

        for (i = 0; works[i] != 0; i ++)
                works[i]->init(runtime);

        while (!done) {
                for (i = 0; works[i] != 0; i++) {
                        works[i]->run();
                }
        }
}